package com.Cychat.commons.entity.pojo;


import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@TableName("post")
public class Post {
    @Schema(description="帖子ID")
    @TableId(value = "post_id", type = IdType.AUTO)
    private Integer postId;
    @Schema(description="发帖人ID")
    private Long userId;
    @Schema(description="帖子标题")
    private String title;
    @Schema(description="帖子内容")
    private String content;
    @Schema(description="图片URL集合")
    private String images;
    @Schema(description="点赞数")
    private Integer likeCount;
    @Schema(description="收藏数")
    private Integer favoriteCount;
    @Schema(description="评论数")
    private Integer commentCount;
    @Schema(description="帖子状态，0为删除，1为正常，2为置顶")
    private Integer status;
    @Schema(description="浏览量")
    private Integer viewCount;
    @Schema(description="发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Schema(description="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private String nickName;
    @TableField(exist = false)
    private String avatarUrl;

}